<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>我要投资</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/Project-list.css">
</head>
<body>
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<p class="pege-name">我要投资</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- content -->
		<div class="obtn">
			<ul class="clear">
				<li class="active">企业贷</li>
				<li>债权贷</li>
				<li>车辆贷</li>
				<li>消费贷</li>
			</ul>
		</div>
		<div class='content' id="movieList" data-role="1">
			<!-- ajax获取项目列表 -->
		</div>
		<!-- content/ -->
		<!-- foot nav fixed -->
		<footer class="fixed-nav">
			<a  class="selected " href="../index.html"><i></i><span>精选</span></a>
			<a  class="investment active" href=""><i></i><span>投资</span></a>
			<a  class="wealth" onclick="testTtate('/api/menu','../Ucenter/Ucenter.html','../login.html')"><i></i><span>财富</span></a>
			<a  class="more" href="../More/M-more.html"><i></i><span>更多</span></a>
		</footer>
		<!-- foot nav fixed /-->
	</div>
	<!-- page_box /-->
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/http-url.js"></script>
	<script type="text/javascript" src="../../js/dropload.js"></script>
	<script type="text/javascript">
		$(function(){
			var dataClick=null;
			// 加载项目数据
			var load_me;
			loadProject(1,0)
			$('.obtn').find('li').click(function(){
				if (dataClick) {
					return
				}
				$('.content').html('');
				if(load_me){
					$(".dropload-down").remove();
					// 锁定
	                load_me.lock();
		              // 无数据
		              load_me.noData();
				}
				var index=$(this).index()+1;
				$('.content').html('');
				$('.obtn').find('li').removeClass('active');
				$(this).addClass('active');
				loadProject(index,0)
			});
			function loadProject(projectName,projectsNuber){
			    // dropload
			    $('.page-box').dropload({
			        scrollArea : window,
			        loadDownFn : function(me){
			        	dataClick=true;
			        	load_me=me;
			          ajaxRequest('/api/projects/all/'+projectName+'/'+projectsNuber+'',null,function(data){
			            // 判断是否加载完毕
			            if(data.data.all==null || data.data.all==''){
			               // 锁定
			                me.lock();
			              // 无数据
			              me.noData();
			            }
		           	 	projectsNuber++;
		           	 	$('.content').append(data.data.all);
		           	    me.resetload();
		           	    dataClick=null;
			          },false);  
			        },
			        threshold :50
			    });	
			}
		});
	</script>
	
</body>
</html>